UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fvcUj72U9u2DsN3yFa3fUzT5On+2FkxCocrl3fKg+VE='
WHERE
key_id = '7c6d18f651445a744b0f9ccadf0e606a5aaf6f7e186a32c885e8a2c178fb5d81'
AND (
token = 'fvcUj72U9u2DsN3yFa3fUzT5On+2FkxCocrl3fKg+VE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)