UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cto1tRP5PVHjH8LRZHyhBw4Bayvk0VvZb9/5oUByFR4='
WHERE
key_id = '49d665d1fd3f304cc6bf7712f095549d283bf7cf2dc31236e475d1b16fe52e19'
AND (
token = 'cto1tRP5PVHjH8LRZHyhBw4Bayvk0VvZb9/5oUByFR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)