UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nT9I6P8IkXBF5U35mHWoNJIBDQWLFPERSdYw37PZ43A='
WHERE
key_id = '7bb3e55678c06b5004a701bc3aeab53c7663c23f4f6414a5414d5881119aaa73'
AND (
token = 'nT9I6P8IkXBF5U35mHWoNJIBDQWLFPERSdYw37PZ43A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)