UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd6nZq6Fru2oO3yeAr3wX6YNMP4qxFw/diZJGAIlUOqg=' 
WHERE 
  key_id = '5d806e37161aace4e028dfe25031bc1d93f6c0ceb270a840ad085630842d0698' 
  AND (
    token = 'd6nZq6Fru2oO3yeAr3wX6YNMP4qxFw/diZJGAIlUOqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038