UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EQNmtrhNckj4RGiEgRSDg4wiO/Duu7NBGIn7SrZHhkM='
WHERE
key_id = '2348df9fff9c7bf173a36ba785b776bbe350e08bfa6b5987344a2306e5c9b5e8'
AND (
token = 'EQNmtrhNckj4RGiEgRSDg4wiO/Duu7NBGIn7SrZHhkM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)