UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DBwvcRSzfvK1ZvIbxn7ZvPsEO56IwOPLkfpmUUjgjEE='
WHERE
key_id = '1761e759bacd7d8bb5efd146c2da50003d4b6c8121ac3193a64d9cf68c6e8b1a'
AND (
token = 'DBwvcRSzfvK1ZvIbxn7ZvPsEO56IwOPLkfpmUUjgjEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)