UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z8bXpqsHDEcrcKAZXNT6Hi8HbKLoqxunNMYKoPN/AG0='
WHERE
key_id = '7cd6befebe1ba7eebae6ac122ef4ea7f726f620f4da578d02df30de5a57c30e1'
AND (
token = 'Z8bXpqsHDEcrcKAZXNT6Hi8HbKLoqxunNMYKoPN/AG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)