UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RLATfaMLKSLdYLnpzeMsXqh5jjIVphbJYCh/7PqWKlA='
WHERE
key_id = '683acf73ca82883f27bcceda680b78d4de31879d2cf4be1158e9c73420f2f48a'
AND (
token = 'RLATfaMLKSLdYLnpzeMsXqh5jjIVphbJYCh/7PqWKlA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)