UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1OfcdW29N5MRqUvfxIb2DLuLN3p/H4GUqzVBkya55bU='
WHERE
key_id = '2e57b43541566b8d52c124ed40eae23e4ae52b217c268192ffae2bd9f24997f5'
AND (
token = '1OfcdW29N5MRqUvfxIb2DLuLN3p/H4GUqzVBkya55bU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)