UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1xSnTixv/qZa9RD49i6zDEBPrBKK3oD6Fwshu3utdek='
WHERE
key_id = 'e7663c8040ab12c6e8bdf34f5fb6a14f78ed6d73185faf97a7bf1b0bbef14a96'
AND (
token = '1xSnTixv/qZa9RD49i6zDEBPrBKK3oD6Fwshu3utdek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)