UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RpjHuBj0VDmchtGXJ8bHr/ghmSl027R1MAFtu8Ms2WU='
WHERE
key_id = 'a0a3c74caaed5796c032cff087fdb8520f43544694eb23225456a72a81d9c983'
AND (
token = 'RpjHuBj0VDmchtGXJ8bHr/ghmSl027R1MAFtu8Ms2WU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)