UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vGCjdX7fL3nM3LnDGrHCXmPF0NyDFn+J88KYx0xpFYY=' 
WHERE 
  key_id = 'c3235caec6faef0eac9d6e22b1c8b765dcaacb4c83fffc74b2f4f538c36ad8e8' 
  AND (
    token = 'vGCjdX7fL3nM3LnDGrHCXmPF0NyDFn+J88KYx0xpFYY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034