UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VJwViX7BOSVEoVTq6O6LE8SKXKcliLj2V6JrMhtXyI8='
WHERE
key_id = '8761d3176bdae873bf97e7f5fd85eb2b3bf99f8923feed8ba6be423bce0a4e0e'
AND (
token = 'VJwViX7BOSVEoVTq6O6LE8SKXKcliLj2V6JrMhtXyI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)