UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'taJSeGEgzIsk/T2B9EJrF7NeaOfnPgVe83Hp/5Nk3pE='
WHERE
key_id = 'c7963d603b4570c09fe2d459a2f9ae96dc043078d8c6d960f33b8d3ae1bc4b45'
AND (
token = 'taJSeGEgzIsk/T2B9EJrF7NeaOfnPgVe83Hp/5Nk3pE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)