UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lhY2PCTgMrMArP43pTReaRfXQmtYnic7KCFflxHbneg='
WHERE
key_id = 'b9e4eba967598136d393218a598fe4a11f5ad7e54d005b90f5ce635b7187a755'
AND (
token = 'lhY2PCTgMrMArP43pTReaRfXQmtYnic7KCFflxHbneg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)