UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vBT5EaPr9cDSxkRzNqKFFKp2YwD1UtX7RKOkiGxx2oQ='
WHERE
key_id = '698f3aad2fd7c13fa413f6f18b1fcac1f7d566901edd94cd306a8419a7a35c4c'
AND (
token = 'vBT5EaPr9cDSxkRzNqKFFKp2YwD1UtX7RKOkiGxx2oQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)