UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '95pinX0qhjOTEHP9Qpjh/PKFAcMv0EtrHqWSIHCCSdg='
WHERE
key_id = '0766c7ae1db96e9fd4f9f0cf7cf32353ddb7fd3f6d65a35156a665855075bf56'
AND (
token = '95pinX0qhjOTEHP9Qpjh/PKFAcMv0EtrHqWSIHCCSdg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)