UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JmbRUCapxLdNXGsV2bOOdsuGn3hop6lm/KZMwh6O+s8='
WHERE
key_id = '0ec9807e071c9e0fd84f76cda22470d7a5bafb2aef523ff448aa221bacaaa2ce'
AND (
token = 'JmbRUCapxLdNXGsV2bOOdsuGn3hop6lm/KZMwh6O+s8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)