UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'praEt8MNTE0AXModE/Vffgy5sAEHQhtk3VEwxfcwHRE='
WHERE
key_id = 'ff442ae9be25f2536106b4da800c27b7ab1ff0ea6eec5dfb0adae847f0e52a13'
AND (
token = 'praEt8MNTE0AXModE/Vffgy5sAEHQhtk3VEwxfcwHRE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)