UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EXViMkBDeK/8v1gUw0+9uMH3ip/fBvEpfJmgRnUr17k='
WHERE
key_id = 'cc8299463e61de751837410aad2fa47bc419149e346fb0bf257dc665959138fb'
AND (
token = 'EXViMkBDeK/8v1gUw0+9uMH3ip/fBvEpfJmgRnUr17k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)