UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kK0tD/T8JwibhAvHDMjychIBq9yIWOLg70Pk+4D1Ph8='
WHERE
key_id = '09123cf1016598fa333b7f465f4351377a0a310d00432ef3111e4550cba78e57'
AND (
token = 'kK0tD/T8JwibhAvHDMjychIBq9yIWOLg70Pk+4D1Ph8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)