UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'enGHcFzGzOfJb/SID2i29PSOBOENDdrP/DLI0hl+BT4='
WHERE
key_id = '155efd531fe18a882893970e0a81b82118650976fe7a2aa3ff7189bcdb9f0344'
AND (
token = 'enGHcFzGzOfJb/SID2i29PSOBOENDdrP/DLI0hl+BT4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)