UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FE9vOL8CznUyTb8YTnWR1r+UAC2WpO0DhbzOuMxk+i4=' 
WHERE 
  key_id = 'f10d3725398a2730dbff6ac950c1ab96f69c409d347151438e6c50e04af863ed' 
  AND (
    token = 'FE9vOL8CznUyTb8YTnWR1r+UAC2WpO0DhbzOuMxk+i4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017