UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W97lzPeUn2lg3aG4uHzDGbrYsvnIMu6R9IrcmQJaSs8='
WHERE
key_id = '605b510eef9f5ef841d64c9a62a3cbb11ea1cd328efca67918e49632d7293e55'
AND (
token = 'W97lzPeUn2lg3aG4uHzDGbrYsvnIMu6R9IrcmQJaSs8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)