UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0XA09lwOFaZOz/vw+/vv+GKKLuWWpL2ZKy/91zfJHbU='
WHERE
key_id = '5ebd221e1fc9446ae84bb9997b2accd34e30dcb71c1cf9f55e602806c63c2502'
AND (
token = '0XA09lwOFaZOz/vw+/vv+GKKLuWWpL2ZKy/91zfJHbU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)