UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F8okSUyV9Hn31AQSjCUqqfjL35maKvMSV8FvxCXA7ok='
WHERE
key_id = '949c2e1b8ac47c2c002ea23e8e34a1d64d0a348d771e63b2fdde6fd7cdb59b50'
AND (
token = 'F8okSUyV9Hn31AQSjCUqqfjL35maKvMSV8FvxCXA7ok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)