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