UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2pCIcKdQd0aNIlkIaJHdMx7hT9ehCjfAzkDK4fQDr20='
WHERE
key_id = '5e0af32a57bebad6a4d133b727b40e68b03a1c4b9c894ebd1a0dead84a79eb71'
AND (
token = '2pCIcKdQd0aNIlkIaJHdMx7hT9ehCjfAzkDK4fQDr20='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)