UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YTPBSOzgtYmGh9faz8Z0IgxIo6jAPjm8gD5HkzlZuOM=' 
WHERE 
  key_id = 'a84a2c286be6f418d35bb2d5fbfa76cf2673fb30ef1b6d41541041e4485e85c4' 
  AND (
    token = 'YTPBSOzgtYmGh9faz8Z0IgxIo6jAPjm8gD5HkzlZuOM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048