UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hp1COjnmg/hAIYNkDlvJaWunAoiIIpIon2R9H8GMaM0=' 
WHERE 
  key_id = '2c6c9ee415693773f32341d1de3241f417264d1807ee3772d8a87eb04c0822ca' 
  AND (
    token = 'hp1COjnmg/hAIYNkDlvJaWunAoiIIpIon2R9H8GMaM0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039