UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U8X9xZJPRzpocm6SmGzRMZ2x0xvTrXQbpOB7RbJvTpg=' 
WHERE 
  key_id = 'd7ad68d73d4fc43d8727cfa1c84c9d6ce3a749d999cfbdfccd9128e2ec59c72b' 
  AND (
    token = 'U8X9xZJPRzpocm6SmGzRMZ2x0xvTrXQbpOB7RbJvTpg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040