UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '21cXVnvS7+17LSwO5cVyvSmQmWJLAGH/uEIPgodFfXA='
WHERE
key_id = 'a646e2e926d7a11d7f4907f36331cf925744988a65588c4e36755bef7ebaaccf'
AND (
token = '21cXVnvS7+17LSwO5cVyvSmQmWJLAGH/uEIPgodFfXA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)