UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+fIN4fYUlk6AJWBJ8GlPeWaROrRpa+97UXlFJXbYG1E=' 
WHERE 
  key_id = 'f1c6959761256b3a23f9871164ea5f7593e411268cc49cb6551c13b274c6744d' 
  AND (
    token = '+fIN4fYUlk6AJWBJ8GlPeWaROrRpa+97UXlFJXbYG1E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030